﻿Imports System.Data.OleDb
Imports System.Data

Partial Class PlacesAlbumDetails
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        If IsPostBack = False Then
            Dim oleDbConn As New OleDb.OleDbConnection(ConfigurationManager.ConnectionStrings("myFirstDatabase").ConnectionString)
            oleDbConn.Open()
            Dim ArtViewSql As String = "INSERT INTO tblPlacesViewed(Neighbor,Place) VALUES(@f1,@f2)"
            Dim cmd As OleDbCommand = New OleDbCommand(ArtViewSql, oleDbConn)
            cmd.CommandType = CommandType.Text
            cmd.Parameters.AddWithValue("@f1", User.Identity.Name)
            cmd.Parameters.AddWithValue("@f2", Request.Params("ID"))
            cmd.ExecuteNonQuery()
        End If
    End Sub
End Class
